﻿//6.	压力容器细分种类的检验结论统计
var spNum = 5,_max=2600;
var legendData_108 = ["1 级","2 级","3 级","4 级","5 级","不合格","合格","监督运行","其他","停止运行","修理后复检","允许使用","整改后使用",];
var y_data_108__108 = ["压力容器","第一类压力容器","第二类压力容器","固定式压力容器","第三类压力容器","汽车罐车","旧目录压力容器","移动式压力容器","医用氧舱","长管拖车","铁路罐车","超高压容器","氧舱","无缝气瓶","特种气瓶","罐式集装箱","焊接气瓶","气瓶"];
// var _data_108_max = [100,100,100,100,100,100,100,100,100,100,100,100,100,],
//1级
    var _data_108_1 = [778, 1615, 430, 1228, 405, 166, 332, 48, 0, 0, 5, 22, 0, 0, 0, 2, 0, 0];
//2级
var _data_108_2 =[3575, 7708, 3143, 3199, 1729, 276, 708, 72, 0, 6, 45, 59, 0, 0, 2, 8, 0, 0];
var   _data_108_3 = [3343, 7698, 3257, 4074, 1728, 5, 1128, 12, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0];
var    _data_108_4 = [39, 226, 164, 124, 40, 0, 58, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0];
var   _data_108_5 = [0, 12, 5, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var   _data_108_6 = [28, 71, 19, 15, 12, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var  _data_108_7 = [69152, 15776, 6867, 6660, 6051, 2530, 568, 494, 260, 120, 117, 59, 38, 7, 7, 7, 4, 1];
var   _data_108_8= [219, 288, 88, 174, 168, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0];
var   _data_108_9= [10735, 10198, 5300, 6123, 1540, 1291, 20449, 258, 188, 278, 182, 3, 11, 1, 834, 9, 32, 915];
var    _data_108_10= [26, 23, 17, 3, 16, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var   _data_108_11= [0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var   _data_108_12= [274, 1285, 832, 628, 486, 2915, 61, 283, 50, 264, 36, 3, 4, 0, 0, 3, 0, 0];
var  _data_108_13= [11, 0, 0, 0, 0, 24, 0, 0, 37, 0, 1, 0, 0, 0, 0, 0, 0, 0];
// _data_108_14 = [21,10,10,13,10,11,15,10,13,15,15,10,13,];
// _data_108_15 = [21,10,10,13,10,11,15,10,13,15,15,10,13,];
// _data_108_16 = [21,10,10,13,10,11,15,10,13,15,15,10,13,];
// _data_108_17 = [21,10,10,13,10,11,15,10,13,15,15,10,13,];
// _data_108_18= [21,10,10,13,10,11,15,10,13,15,15,10,13,];
var fomatter_fn = function(v) {
    return v.value
}
var _label = {
    normal: {
        // show: true,
        position: 'inside',
        formatter: fomatter_fn,
        textStyle: {
            color: '#fff',
            fontSize: 16
        }
    }
};
option108 = {
    // backgroundColor: '#091034',
    legend: {
        data: legendData_108,
        textStyle: {
            color: '#fff',
            fontSize: 16
        }
    },
    grid: {
        containLabel: true,
        left: 0,
        right: 15,
        bottom: 30
    },
    tooltip: {
        show: true,
        backgroundColor: '#fff',
        borderColor: '#ddd',
        borderWidth: 1,
        textStyle: {
            color: '#3c3c3c',
            fontSize: 16
        },
        formatter: function(p) {
            // console.log(p);
            var indexX =0;
            for(var x=0;x<y_data_108__108.length;x++){
                if(p.name === y_data_108__108[x]){
                    indexX = x;
                    break;
                }
            }
            var sum = _data_108_1[indexX] + _data_108_2[indexX] + _data_108_3[indexX] + _data_108_4[indexX] + _data_108_5[indexX] + _data_108_6[indexX] + _data_108_7[indexX] + _data_108_8[indexX] + _data_108_9[indexX] + _data_108_10[indexX] + _data_108_11[indexX] + _data_108_12[indexX] + _data_108_13[indexX];

            var _arr = p.seriesName.split('/'),
                idx = p.seriesIndex;//1，2，3
            // return p.name+ '<br>' +'结论：' + p.seriesName + '<br>' + '数量：' + p.value + '<br>';
            return p.name+ '<br>' +'结论：' + p.seriesName + '<br>' + '数量：' + p.value + '<br>' + '占比：' + (p.value / sum * 100).toFixed(2) + '%，总数:'+sum;
        },
        extraCssText: 'box-shadow: 0 0 5px rgba(0, 0, 0, 0.1)'
    },
    xAxis: {
        // splitNumber: spNum,
        // interval: _max / spNum,
        // max: _max,
        axisLabel: {
            show: false,
            // formatter: function(v) {
            //     var _v = (v / _max * 100).toFixed(0);
            //     return _v == 0 ? _v : _v + '%';
            // }
        },
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        splitLine: {
            show: false
        }

    },
    yAxis: [{
        data: y_data_108__108,
        axisLabel: {
            fontSize: 16,
            color: '#fff'

        },
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        splitLine: {
            show: false
        }
    }, {
        show: false,
        data: y_data_108__108,
        axisLine: {
            show: false
        }
    }],
    series: [{
        type: 'bar',
        name: '1 级',
        stack: '2',
        label: _label,
        legendHoverLink: false,
        barWidth: 40,
        itemStyle: {
            normal: {
                color: '#7E47FF'
            },
            emphasis: {
                color: '#7E47FF'
            }
        },
        data: _data_108_1
    }, {
        type: 'bar',
        name: '2 级',
        stack: '2',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#FD5916'
            },
            emphasis: {
                color: '#FD5916'
            }
        },
        data: _data_108_2
    }, {
        type: 'bar',
        stack: '2',
        name: '3 级',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#01A4F7'
            },
            emphasis: {
                color: '#01A4F7'
            }
        },
        data: _data_108_3
    }, {
        type: 'bar',
        stack: '2',
        name: '4 级',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#2EDDCD'
            },
            emphasis: {
                color: '#2EDDCD'
            }
        },
        data: _data_108_4
    }, {
        type: 'bar',
        stack: '2',
        name: '5 级',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#aedd9f'
            },
            emphasis: {
                color: '#aedd9f'
            }
        },
        data: _data_108_5
    }, {
        type: 'bar',
        stack: '2',
        name: '不合格',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#ddaf5a'
            },
            emphasis: {
                color: '#ddaf5a'
            }
        },
        data: _data_108_6
    }, {
        type: 'bar',
        stack: '2',
        name: '合格',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#29dd26'
            },
            emphasis: {
                color: '#29dd26'
            }
        },
        data: _data_108_7
    }, {
        type: 'bar',
        stack: '2',
        name: '监督运行',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#ddba30'
            },
            emphasis: {
                color: '#ddba30'
            }
        },
        data: _data_108_8
    }, {
        type: 'bar',
        stack: '2',
        name: '其他',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#8ea5dd'
            },
            emphasis: {
                color: '#8ea5dd'
            }
        },
        data: _data_108_9
    }, {
        type: 'bar',
        stack: '2',
        name: '停止运行',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#dd69b7'
            },
            emphasis: {
                color: '#dd69b7'
            }
        },
        data: _data_108_10
    }, {
        type: 'bar',
        stack: '2',
        name: '修理后复检',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#d6ddb5'
            },
            emphasis: {
                color: '#d6ddb5'
            }
        },
        data: _data_108_11
    }, {
        type: 'bar',
        stack: '2',
        name: '允许使用',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#99cbdd'
            },
            emphasis: {
                color: '#99cbdd'
            }
        },
        data: _data_108_12
    }, {
        type: 'bar',
        stack: '2',
        name: '整改后使用',
        legendHoverLink: false,
        barWidth: 40,
        label: _label,
        itemStyle: {
            normal: {
                color: '#965ddd'
            },
            emphasis: {
                color: '#965ddd'
            }
        },
        data: _data_108_13
    }]
};
